package cn.stylefeng.guns.modular.business.frequency.syssite.mapper;

import cn.stylefeng.guns.modular.business.frequency.cmcompany.model.result.PkgLinkman;
import cn.stylefeng.guns.modular.business.frequency.syssite.model.result.*;
import cn.stylefeng.guns.modular.business.frequency.userawardbase.model.result.UserAwardBaseResult;
import cn.stylefeng.guns.sys.modular.user.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.stylefeng.guns.modular.business.frequency.syssite.entity.SysSite;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * sys_site Mapper 接口
 *
 * @author yujie
 * @date 2023/05/09 17:17
 */
public interface SysSiteMapper extends BaseMapper<SysSite> {

    List<PkgSite> getSiteList(@Param("siteDTO") SiteDTO siteDTO);

    List<String> getUserIds(@Param("id") String id);


    Page<PkgLinkman> getCompanyLinkmanList(@Param("page") Page<Object> defaultPage,@Param("userIds") List<String> userIds);

    List<SimpleSiteVO> getSimpleSiteList();


    PkgSite getSiteDetail(@Param("id") String id);


    List<String> getServiceCodes(@Param("id") String id);

    int countByName(@Param("id") String id, @Param("name") String name,@Param("tenantId") Long tenantId);

    int countServiceCode(@Param("id") String id, @Param("cityCode") String cityCode, @Param("tenantId") Long tenantId);

    void deleteCityCode(@Param("siteId") String id);

    void addSiteCity(@Param("siteId") String siteId, @Param("chargeCodeList") List<String> chargeCodeList, @Param("tenantId") Long tenantId);

    int countDeptBySiteId(@Param("id") String id);

    void deleteSite(@Param("id")String id);

    List<SysUser> getUserList(@Param("siteId") String siteId, @Param("tenantId") Long tenantId);

    List<SiteBonusExport> getSiteBonusList(@Param("month") String month, @Param("tenantId") Long tenantId);

    List<SiteRoyaltyExport> getSiteRoyaltyList(@Param("month") String month, @Param("tenantId") Long tenantId);

    List getCompanyExportData(List<String> userIds);

    List<UserAwardBaseResult>  userAwardList(@Param("id") Long id);

    List<SysSite> getListByChargeCode(@Param("cityCode") String startCityCode,@Param("tenantId") Long tenantId);

    Long getIdBySiteId(@Param("siteId") Long siteId, @Param("tenantId") Long tenantId);

    Long getSiteIdByUser(@Param("userId") Long userId);

    String getNameById(@Param("id") Long siteId);

}